Medium carrying device, control method, and control program

ABSTRACT

Provided are a medium conveyance apparatus, control method, and control program is to enable more precisely detecting an end part in a main scan direction of a medium from an image. A medium conveyance apparatus includes a conveying module to convey a medium, an imaging device to capture an image of the conveyed medium, a storage device to store a low reliability region inside an input image of a medium captured by the imaging device based on a positional relationship between an imaging position of the imaging device and arrangement position of the conveying module, an edge pixel detection module to detect edge pixels from the input image, an end part detection module to detect an end part in a main scan direction of the medium based on edge pixels detected from a region not including the low reliability region inside the input image, and an output control module to output information relating to the detected end part.

FIELD

The present disclosure relates to a medium conveyance apparatus, moreparticularly relates to a medium conveyance apparatus to detect an endpart of the medium from an image of a medium being conveyed.

BACKGROUND

In general, a scanner or other medium conveyance apparatus for reading adocument or other medium has the function of identifying a regionincluding a medium in a read image so as to cut out the region includingthe medium from the read image. For this reason, a medium conveyanceapparatus is asked to precisely detect end parts of the medium.

An image processing device which determines whether a thickness of adocument is not constant based on a difference of brightness of abackground region of an input image and, if the thickness is notconstant, digitalizing the image by a threshold value in accordance withthe brightness of the background region to identify the backgroundregion and document region has been disclosed (see PTL 1).

CITATIONS LIST Patent Literature

-   Patent Literature 1: Japanese Unexamined Patent Publication No.    2019-193159

SUMMARY

In a medium conveyance apparatus, it is desirable to more preciselydetect an end part of a medium from an image.

An object of the medium conveyance apparatus, control method, andcontrol program is to enable more precisely detecting an end part in amain scan direction of a medium from an image.

According to some embodiments, a medium conveyance apparatus includes aconveying module to convey a medium, an imaging device to capture animage of the conveyed medium, a storage device to store a lowreliability region inside an input image of a medium captured by theimaging device based on a positional relationship between an imagingposition of the imaging device and arrangement position of the conveyingmodule, an edge pixel detection module to detect edge pixels from theinput image; an end part detection module to detect an end part in amain scan direction of the medium based on edge pixels detected from aregion not including the low reliability region inside the input image;and an output control module to output information relating to thedetected end part.

According to some embodiments, a medium conveyance apparatus includes aconveying module to convey a medium, a reference member having a singlecolor, an imaging device located facing the reference member, to capturean image of the conveyed medium and a vicinity of the conveyed medium,an edge pixel detection module to detect a plurality of edge pixels froman input image of the medium and vicinity of the medium captured by theimaging device, a fluctuation region detection module to detect afluctuation region with tonal values fluctuating with respect toperipheral pixels inside a region in which the reference member isincluded in the input image based on a positional relationship of theplurality of edge pixels detected by the edge pixel detection module, anend part detection module to detect an end part in a main scan directionof the medium based on edge pixels detected from a region not includingthe fluctuation region detected by the fluctuation region detectionmodule inside the input image, and an output control module to outputinformation relating to the detected end part.

According to some embodiments, a control method of a medium conveyanceapparatus having a conveying module to convey a medium, an imagingdevice to capture an image of the conveyed medium, and a storage device,includes storing in the storage device a low reliability region insidean input image of a medium captured by the imaging device based on apositional relationship between an imaging position of the imagingdevice and arrangement position of the conveying module, detecting edgepixels from the input image, detecting an end part in a main scandirection of the medium based on edge pixels detected from a region notincluding the low reliability region inside the input image, andoutputting information relating to the detected end part.

According to some embodiments, a control method of a medium conveyanceapparatus having a conveying module to convey a medium, a referencemember having a single color, and an imaging device located facing thereference member, to capture an image of the conveyed medium and avicinity of the conveyed medium, includes detecting a plurality of edgepixels from an input image of the medium and vicinity of the mediumcaptured by the imaging device, detecting a fluctuation region withtonal values fluctuating with respect to peripheral pixels inside aregion in which the reference member is included in the input imagebased on a positional relationship of the plurality of edge pixelsdetected, detecting an end part in a main scan direction of the mediumbased on edge pixels detected from a region not including thefluctuation region inside the input image, and outputting informationrelating to the detected end part.

According to some embodiments, a control program of a medium conveyanceapparatus having a conveying module to convey a medium, an imagingdevice to capture an image of the conveyed medium, and a storage device,causes the medium conveyance apparatus to execute storing in the storagedevice a low reliability region inside an input image of a mediumcaptured by the imaging device based on a positional relationshipbetween an imaging position of the imaging device and arrangementposition of the conveying module, detecting edge pixels from the inputimage, detecting an end part in a main scan direction of the mediumbased on edge pixels detected from a region not including the lowreliability region inside the input image, and outputting informationrelating to the detected end part.

According to some embodiments, a control program of a medium conveyanceapparatus having a conveying module to convey a medium, a referencemember having a single color, and an imaging device located facing thereference member, to capture an image of the conveyed medium and avicinity of the conveyed medium, causes the medium conveying apparatusto execute detecting a plurality of edge pixels from an input image ofthe medium and vicinity of the medium captured by the imaging device,detecting a fluctuation region with tonal values fluctuating withrespect to peripheral pixels inside a region in which the referencemember is included in the input image based on a positional relationshipof the plurality of edge pixels detected, detecting an end part in amain scan direction of the medium based on edge pixels detected from aregion not including the fluctuation region inside the input image, andoutputting information relating to the detected end part.

According to the embodiments, the medium conveyance apparatus, controlmethod, and control program can more precisely detect an end part in amain scan direction of a medium from an image.

The object and advantages of the invention will be realized and attainedby means of the elements and combinations, in particular, described inthe claims. It is to be understood that both the foregoing generaldescription and the following detailed description are exemplary andexplanatory, and are not restrictive of the invention, as claimed.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a perspective view showing a medium conveyance apparatus 100according to an embodiment.

FIG. 2 is a view for explaining a conveyance route inside of a mediumconveyance apparatus 100.

FIG. 3 is a block diagram showing the schematic constitution of a mediumconveyance apparatus 100.

FIG. 4 is a view showing the schematic constitution of a storage device140 and processing circuit 150.

FIG. 5 is a view showing one example of a data structure of a regiontable.

FIG. 6A is a schematic view for explaining a low reliability region.

FIG. 6B is a schematic view for explaining a low reliability region.

FIG. 7A is a schematic view for explaining a low reliability region.

FIG. 7B is a schematic view for explaining a low reliability region.

FIG. 8 is a flow chart showing an example of the operation of mediumreading processing.

FIG. 9 is a flow chart showing an example of the operation of mediumreading processing.

FIG. 10 is a schematic view showing one example of an input image 1000.

FIG. 11 is a schematic view for explaining top end edge pixels.

FIG. 12 is a schematic view for explaining a histogram 1200.

FIG. 13 is a schematic view for explaining left end edge pixels etc.

FIG. 14 is a flow chart showing an example of the operation of othermedium reading processing.

FIG. 15 is a flow chart showing an example of the operation of othermedium reading processing.

FIG. 16 is a schematic view for explaining fluctuation regions.

FIG. 17 is a schematic view for explaining fluctuation regions.

FIG. 18 is a schematic view for explaining other fluctuation regions.

FIG. 19 is a view showing the schematic constitution of a processingcircuit 250 of another medium conveyance apparatus.

DESCRIPTION OF EMBODIMENTS

Hereinafter, a medium conveyance apparatus, a control method and acontrol program according to an embodiment will be described withreference to the drawings. However, it should be noted that thetechnical scope of the invention is not limited to these embodiments,and extends to the inventions described in the claims and theirequivalents.

FIG. 1 is a perspective view showing a medium conveyance apparatus 100constituted as an image scanner. The medium conveyance apparatus 100conveys a document medium and captures an image of it. The medium isprinting paper, thick paper, a card, passport, etc. The card is forexample a plastic resin card. In particular, the card is an ID(identification) card prescribed by the ISO (International Organizationfor Standardization)/IEC (International Electrotechnical Commission)7810. Note that the card may also be another type of card. The mediumconveyance apparatus 100 may also be a facsimile, copier, multifunctionperipheral (MFP), etc.

The medium conveyance apparatus 100 is provided with a lower housing101, upper housing 102, stacking tray 103, ejection tray 104, operatingdevice 105, display device 106, etc.

The upper housing 102 is located at a position covering the uppersurface of the medium conveyance apparatus 100 and engages with thelower housing 101. The stacking tray 103 engages with the lower housing101 to be able to stack the conveyed medium. The ejection tray 104engages with the lower housing 101 to be able to hold the conveyedmedium.

The operating device 105 has buttons or other input devices and aninterface circuit for acquiring signals from the input devices, receivesinput operations of a user, and outputs operating signals correspondingto the input operations of a user. The display device 106 has a displayincluding liquid crystals, organic Els (Electro-Luminescence), etc., andan interface circuit for outputting image data to the display anddisplays the image data on the display.

FIG. 2 is a view for explaining a conveyance route inside of the mediumconveyance apparatus 100.

The conveyance route inside of the medium conveyance apparatus 100 has afirst medium sensor 111, feed roller 112, brake roller 113, firstconveyance roller 114, second conveyance roller 115, second mediumsensor 116, first imaging device 117 a, second imaging device 117 b,third conveyance roller 118, fourth conveyance roller 119, etc. Notethat the numbers of the rollers are not limited to single ones. Thenumbers of the rollers may respectively be multiple ones as well. Below,the first imaging device 117 a and the second imaging device 117 b willsometimes be referred to all together as the “imaging devices 117”.

The upper surface of the lower housing 101 forms a lower guide 107 a ofthe conveyance path of the medium, while the lower surface of the upperhousing 102 forms an upper guide 107 b of the conveyance path of themedium. In FIG. 2 , the arrow A1 shows the conveyance direction. Below,“upstream” will mean upstream of the medium in the conveyance directionA1 of the medium, while “downstream” means downstream of the medium inthe conveyance direction A1.

The first medium sensor 111 is located at an upstream side of the feedroller 112 and brake roller 113. The first medium sensor 111 has acontact detection sensor and detects if the stacking tray 103 has themedium stacked on it. The first medium sensor 111 generates and outputsa first medium signal with a signal value changing between a state wherethe stacking tray 103 has the medium stacked on it and a state where itdoes not have the medium stacked on it.

The feed roller 112 and brake roller 113 are provided at the upstreamside of the first conveyance roller 114 and the second conveyance roller115. The feed roller 112 is provided at the lower housing 101 and feedsa medium stacked on the stacking tray 103 in order from the bottom side.The brake roller 113 is provided at the upper housing 102 and is locatedfacing the feed roller 112.

The first conveyance roller 114 and the second conveyance roller 115 areprovided at the downstream side of the feed roller 112 and brake roller113. The first conveyance roller 114 is provided at the lower housing101. The second conveyance roller 115 is provided at the upper housing102 and is located facing the first conveyance roller 114.

The second medium sensor 116 is located at the downstream side of thefirst conveyance roller 114 and the second conveyance roller 115 and atthe upstream side of the imaging devices 117. The second medium sensor116 detects whether a medium is present at that position. The secondmedium sensor 116 includes a light emitter and a light receiver providedat one side of the medium conveyance path and a mirror or otherreflection members provided at positions facing the light emitter andthe light receiver across the conveyance path. The light emitter emitslight toward the conveyance path. On the other hand, the light receiverreceives light emitted by the light emitter and reflected by thereflection member, and generates and outputs a second medium signal ofan electrical signal corresponding to the intensity of the lightreceived. If a medium is present at the position of the second mediumsensor 116, the light emitted by the light emitter is blocked by themedium, so the signal value of the second medium signal changes betweenthe state where a medium is present at the position of the second mediumsensor 116 and the state where a medium is not present. Note that thelight emitter and the light receiver may also be provided at positionsfacing each other across the conveyance path and the reflection membermay also be omitted.

The first imaging device 117 a and the second imaging device 117 b areexamples of the imaging device. The first imaging device 117 a has afirst imaging sensor 121 a and first reference member 122 a. The secondimaging device 117 b has a second imaging sensor 121 b, second referencemember 122 b, and conveyance guide 123 b.

The first imaging sensor 121 a is a contact optical system type CIS(contact image sensor) line sensor having imaging elements comprised ofCMOS's (complementary metal oxide semiconductors) located in a line inthe main scan direction. The first imaging sensor 121 a is locatedfacing the second reference member 122 b functioning as a backing.Further, the first imaging device 117 a has a lens for forming an imageon an imaging element and an A/D converter for amplifying the electricalsignal output from the imaging element and converting it from an analogto digital (A/D) format. The first imaging device 117 a captures animage of the front surface of the conveyed medium and the vicinity ofthe medium every certain interval at the imaging position P1 toconsecutively generate and output line images. In other words, there aresingle pixels in the vertical direction (sub scan direction) of the lineimage, while there are multiple pixels in the horizontal direction (mainscan direction). Using the later explained processing circuit, apredetermined number of line images are combined and an input image isgenerated. In other words, the input image is an image of a mediumcaptured by the imaging devices 117.

The first imaging sensor 121 a captures an image of the second referencemember 122 b when the medium is not being conveyed. The surface of thesecond reference member 122 b facing the first imaging sensor 121 a hasa single color (for example, white color). The medium conveyanceapparatus 100 shades or otherwise corrects the image based on the imagesignal of the second reference member 122 b captured.

The second imaging sensor 121 b is a contact optical system type CISline sensor having imaging elements comprised of CMOS's located in aline in the main scan direction. The second imaging sensor 121 b islocated facing the first reference member 122 a functioning as abacking. Further, the second imaging device 117 b has a lens for formingan image on an imaging element and an A/D converter for amplifying theelectrical signal output from the imaging element and converting it froman analog to digital (A/D) format. The second imaging device 117 bcaptures an image of the back surface of the conveyed medium and thevicinity of the medium every certain interval at the imaging position P2to consecutively generate and output line images. Using the laterexplained processing circuit, a predetermined number of line images arecombined and an input image is generated. In other words, the inputimage is an image of a medium captured by the imaging devices 117.

The second imaging sensor 121 b captures an image of the first referencemember 122 a when the medium is not being conveyed. The surface of thefirst reference member 122 a facing the second imaging sensor 121 b hasa single color (for example, white color). The medium conveyanceapparatus 100 shades or otherwise corrects the image based on the imagesignal of the first reference member 122 a captured.

The conveyance guide 123 b is one example of a member to move inassociation with the second imaging device 117 b. The conveyance guide123 b is provided integrally with the second imaging device 117 b. Theconveyance guide 123 b has an eave-like shape and guides the mediumconveyed by the first conveyance roller 114 and the second conveyanceroller 115 to between the first imaging device 117 a and the secondimaging device 117 b. The top surface of the conveyance guide 123 b hasattached to one end of a not shown spring which is supported at theother end at the upper housing 102. The conveyance guide 123 b is biasedby that spring in a direction heading toward the first imaging device117 a side. The second imaging device 117 b is provided to be able tomove in the top direction in the height direction A8 perpendicular tothe medium conveyance direction. On the other hand, the first imagingdevice 117 a is fastened to the lower housing 101. When a medium havinga predetermined thickness and high rigidity like thick paper, a card, orpassport is conveyed, the conveyance guide 123 b moves upward due tothat medium. The second imaging device 117 b moves upward in associationwith movement of the conveyance guide 123 b. In this way, the secondimaging device 117 b is provided to be able to move in the top directiondue to being pushed up by the conveyed medium.

The conveyance guide 123 b is formed by a member separate from thesecond imaging device 117 b. Note that the conveyance guide 123 b mayalso be formed by a member integral with the second imaging device 117b. Further, the second imaging device 117 b may be fastened, the firstimaging device 117 a may be located to be able to move in the heightdirection A8, and the conveyance guide 123 b may be provided integrallywith the first imaging device 117 a. In this case, the conveyance guide123 b moves downward due to the conveyed medium, and the first imagingdevice 117 a moves downward in association with movement of theconveyance guide 123 b. Further, the conveyance guide 123 b may beomitted, and the first imaging device 117 a or the second imaging device117 b may be provided to be able to move in the height direction A8 dueto the conveyed medium.

Note that the medium conveyance apparatus 100 may have only one of thefirst imaging device 117 a and the second imaging device 117 b and readonly one surface of the medium. Further, instead of the contact opticalsystem type CIS line sensor provided with imaging elements comprised ofCMOS's, a contact optical system type CIS line sensor provided withimaging elements comprised of CCDs (charge coupled devices) may also beutilized. Further, a reduction optical system type line sensor providedwith imaging elements comprised of CMOS's or CCD's may also be used.Below, the first imaging sensor 121 a and the second imaging sensor 121b will sometimes be referred to all together as the “imaging sensors121”. Further, the first reference member 122 a and the second referencemember 122 b will sometimes be referred to all together as the“reference members 122”.

The third conveyance roller 118 and the fourth conveyance roller 119 areprovided at the downstream side of the imaging devices 117. The thirdconveyance roller 118 is provided at the lower housing 101. The fourthconveyance roller 119 is provided at the upper housing 102 and islocated facing the third conveyance roller 118.

The medium stacked on the stacking tray 103 is conveyed between thelower side guide 107 a and the upper side guide 107 b toward the mediumconveyance direction A1 by the feed roller 112 rotating in the directionof the arrow A2 of FIG. 2 . The brake roller 113 rotates in thedirection of the arrow A3 at the time of conveyance of the medium. Dueto the actions of the feed roller 112 and brake roller 113, if thestacking tray 103 has a plurality of the medium stacked on it, in themedium stacked on the stacking tray 103, only the medium contacting thefeed roller 112 will be separated. Due to this, conveyance of the mediumother than the separated medium is restricted (prevention ofmulti-feed).

The medium is guided by the lower side guide 107 a and the upper sideguide 107 b while being fed between the first conveyance roller 114 andthe second conveyance roller 115. The medium is sent between the firstimaging device 117 a and the second imaging device 117 b by the firstconveyance roller 114 and the second conveyance roller 115 respectivelyrotating in the directions of the arrow A4 and arrow A5. The medium readby the imaging devices 117 is ejected on the ejection tray 104 by thethird conveyance roller 118 and fourth conveyance roller 119respectively rotating in the directions of the arrow A6 and arrow A7.The feed roller 112, brake roller 113, first conveyance roller 114,second conveyance roller 115, third conveyance roller 118, and fourthconveyance roller 119 are examples of the conveying modules and conveythe medium.

FIG. 3 is a block diagram showing the schematic constitution of themedium conveyance apparatus 100.

The medium conveyance apparatus 100 further has, in addition to theabove-mentioned constitution, a motor 131, interface device 132, storagedevice 140, processing circuit 150, etc.

The motor 131 includes one or more motors and makes the feed roller 112,brake roller 113, first conveyance roller 114, second conveyance roller115, third conveyance roller 118, and fourth conveyance roller 119rotate by control signals from the processing circuit 150 so as toconvey the medium.

The interface device 132 has an interface circuit based on for example aUSB or other serial bus and is electrically connected with a not showninformation processing apparatus (for example, a personal computer,mobile information terminal, etc.) to transmit and receive images andvarious information. Further, instead of the interface device 132, acommunication module having an antenna transmitting and receivingwireless signals and a wireless communication interface circuit fortransmitting and receiving signals through a wireless communication linein accordance with a predetermined communication protocol may be used.The predetermined communication protocol is for example a wireless LAN(local area network).

The storage device 140 has a RAM (random access memory), ROM (read onlymemory), or other memory device, hard disk or other fixed disk device,flexible disk, optical disk, or other portable storage device, etc.Further, the storage device 140 stores computer programs, databases,tables, etc., used for various processing of the medium conveyanceapparatus 100. The computer programs may be installed on the storagedevice 140 from a computer-readable, non-transitory medium such as aCD-ROM (compact disc read only memory), DVD-ROM (digital versatile discread only memory), etc., by using a well-known setup program, etc.

Further, the storage device 140 stores as data a region table showinglow reliability regions in the input image. Low reliability regions areregions having a high possibility of fluctuation of the tonal values ofthe pixels in which the reference members 122 is captured, in the subscan direction in the input image. The processing circuit 150 detectsend parts without using edge pixels detected from the low reliabilityregions when detecting the end parts in a main scan direction of themedium from input image. Details of the region table will be explainedlater. The storage device 140 is one example of the storage device.

The processing circuit 150 operates based on programs stored in advancein the storage device 140. Note that instead of the processing circuit150, a DSP (digital signal processor), LSI (large scale integratedcircuit), ASIC (application specific integrated circuit), FPGA(field-programmable gate array), etc., may also be used.

The processing circuit 150 is connected with the operating device 105,display device 106, first medium sensor 111, second medium sensor 116,imaging devices 117, motor 131, interface device 132, storage device140, etc., and control these parts. The processing circuit 150 controlsthe drive by the motor 131, controls imaging by the imaging devices 117,etc., acquires images, and transmits them through the interface device132 to a not shown information processing apparatus. Further, theprocessing circuit 150 detects end parts of the medium based on imagescaptured by the imaging devices 117.

FIG. 4 is a view showing the schematic constitutions of the storagedevice 140 and processing circuit 150.

As shown in FIG. 4 , the storage device 140 stores a setting program141, control program 142, image acquisition program 143, edge pixeldetection program 144, end part detection program 145, medium widthdetection program 146, output control program 147, fluctuation regiondetection program 148, etc. These programs are function modules loadedby software operating on a processor. The processing circuit 150 readsthe programs stored in the storage device 140 and operates in accordancewith the read programs. Due to this, the processing circuit 150functions as a setting module 151, control module 152, image acquisitionmodule 153, edge pixel detection module 154, end part detection module155, medium width detection module 156, output control module 157, andfluctuation region detection module 158.

FIG. 5 is a view showing one example of the data structure of the regiontable.

As shown in FIG. 5 , the region table stores the low reliability regionsfor the different combinations of imaging devices 117 and conveyingmodules. The imaging devices 117 for which the low reliability regionsare set include the first imaging device 117 a and a second imagingdevice 117 b. The conveying modules for which the low reliabilityregions are set include the pair of the feed roller 112 and brake roller113, the pair of the first conveyance roller 114 and second conveyanceroller 115, and the pair of the third conveyance roller 118 and fourthconveyance roller 119. The low reliability regions are set based on thepositional relationship of the imaging positions of the imaging devices117 and the arrangement positions of the conveying modules. As the lowreliability regions, regions captured by the imaging devices 117 in theinput image when the medium nipped by the conveying modules contacts theconveyance guide 123 b are set. Note that if the conveyance guide 132 isomitted, as the low reliability regions, regions captured by the imagingdevices 117 in the input image when the medium nipped by the conveyingmodules contacts the second imaging device 117 b are set. Alternatively,as the low reliability regions, regions captured by the imaging devices117 in the input image when the front end or the back end of theconveyed medium passes the conveying modules are set.

FIG. 6A, FIG. 6B, FIG. 7A, and FIG. 7B are schematic views forexplaining the low reliability regions.

FIG. 6A is a schematic view for explaining images captured by theimaging devices 117 when a medium nipped by the feed roller 112 andbrake roller 113 contacts the second imaging device 117 b.

As shown in FIG. 6A, a nip position N1 of the roller 112 and brakeroller 113 in the height direction A8 is located at the upper side ofthe imaging surface (conveyance surface) of the first imaging device 117a. If a medium having a predetermined thickness and having rigidity isconveyed, the conveyed medium M is nipped by the feed roller 112 andbrake roller 113 and is conveyed so that the front end moves along theimaging surface of the first imaging device 117 a. In other words, themedium M is conveyed so that the front end is inclined to the bottomside. For this reason, the medium M contacts the end parts of the secondimaging device 117 b (conveyance guide 123 b) at the upstream side at aspecific timing, and the second imaging device 117 b is pushed up by themedium M and moves in the top direction. If the second imaging device117 b moves in the top direction, the distance between the first imagingdevice 117 a and the second imaging device 117 b increases. Therefore,inside the input image, the tonal values of the pixels of the secondreference member 122 b captured by the first imaging sensor 121 a aroundthis timing and the tonal values of the pixels of the first referencemember 122 a captured by the second imaging sensor 121 b around thistiming fluctuate.

The setting module 151 sets as the low reliability regions the regionscaptured by the imaging devices 117 when a medium with a front endcontacting the imaging surface of the first imaging device 117 a andnipped by the feed roller 112 and brake roller 113 contacts the end partof the second imaging device 117 b at the upstream side. The settingmodule 151 sets as the front end position of the medium the positionwhere the line passing through the nip position N1 of the feed roller112 and brake roller 113 and the end part of the second imaging device117 b at the upstream side abuts against the imaging surface of thefirst imaging device 117 a. The setting module 151 sets as lowreliability positions the positions on the back end of the medium sideof positions where the front end of the medium is included by distancescorresponding to distances between the set front end position and theimaging positions P1, P2 of the imaging devices 117 in the verticaldirection (sub scan direction) inside the input image. Further, thesetting module 151 sets as the low reliability regions the regions of apredetermined range (for example 5 pixels) centered about the set lowreliability positions in the vertical direction inside the input image.Note that due to the conveyance speed of the medium or the members ofthe medium conveyance path, after the second imaging device 117 b movesin the top direction, it may bounce (vibrate) and the time periodsduring which the tonal values of the reference members 122 inside theinput image fluctuate may be longer. The predetermined range is setconsidering the effects of the conveyance speed of the medium, themembers of the medium conveyance path, etc.

Due to this, the medium conveyance apparatus 100 can keep regions inwhich the tonal values of the background in the input image fluctuatefrom being mistakenly detected as edges of the medium.

FIG. 6B is a schematic view for explaining the regions captured by theimaging devices 117 inside the input image when the back end of aconveyed medium passes the feed roller 112 and brake roller 113.

As shown in FIG. 6B, when the back end of the medium M passes the nipposition N1 of the feed roller 112 and brake roller 113, the medium Mvibrates due to the shock of separation from the feed roller 112 and thebrake roller 113. For this reason, the second imaging device 117 bpushed up by the medium M vibrates in association with the medium M.When the second imaging device 117 b vibrates, the distance between thefirst imaging device 117 a and the second imaging device 117 b changes.Therefore, inside the input image, the tonal values of the pixels of thesecond reference member 122 b captured by the first imaging sensor 121 aaround this timing and the tonal values of the pixels of the firstreference member 122 a captured by the second imaging sensor 121 baround this timing fluctuate.

The setting module 151 sets as the low reliability regions the regionscaptured by the imaging devices 117 when the back end of the conveyedmedium passes the feed roller 112 and brake roller 113. The settingmodule 151 sets as the front end position of the medium the position onthe downstream side of the nip position N1 of the feed roller 112 andbrake roller 113 by exactly the amount of the long side size (or theamount of the short side size) of an ID card prescribed by ISO/IEC7810.The setting module 151 sets as low reliability positions the positionson the back end of the medium side of positions where the front end ofthe medium is included by distances corresponding to distances betweenthe set front end position and the imaging positions P1, P2 of theimaging devices 117 in the vertical direction (sub scan direction)inside the input image. Further, the setting module 151 sets as the lowreliability regions the regions of a predetermined range centered aboutthe set low reliability positions in the vertical direction inside theinput image. Due to this, the medium conveyance apparatus 100 can bekept from mistakenly detecting regions with tonal values of thebackground in input image which fluctuate as edges of the medium.

FIG. 7A is a schematic view for explaining regions captured by theimaging devices 117 inside input image when the front end of theconveyed medium passes the third conveyance roller 118 and fourthconveyance roller 119.

As shown in FIG. 7A, the front end of the medium M strikes the thirdconveyance roller 118 or fourth conveyance roller 119 and is guided tothe nip position N3 of the third conveyance roller 118 and fourthconveyance roller 119 when passing the third conveyance roller 118 andfourth conveyance roller 119. The medium M vibrates due to the shockcaused by striking the third conveyance roller 118 or fourth conveyanceroller 119, so the second imaging device 117 b pushed up by the medium Mvibrates in association with the medium M.

The setting module 151 sets as the low reliability regions the regionscaptured by the imaging devices 117 when the front end of the conveyedmedium passes the third conveyance roller 118 and fourth conveyanceroller 119. The setting module 151 sets as the front end position of themedium the nip position N3 of the third conveyance roller 118 and fourthconveyance roller 119. The setting module 151 sets as low reliabilitypositions the positions on the back end of the medium side of positionswhere the front end of the medium is included by distances correspondingto distances between the set front end position and the imagingpositions P1, P2 of the imaging devices 117 in the vertical direction(sub scan direction) inside the input image. Further, the setting module151 sets as the low reliability regions the regions in predeterminedranges centered about the set low reliability positions in the verticaldirection inside the input image. Due to this, the medium conveyanceapparatus 100 can keep regions in which the tonal values of thebackground in the input image fluctuate from being mistakenly detectedas edges of the medium.

FIG. 7B is a schematic view for explaining regions captured by theimaging devices 117 inside input image when the back end of the conveyedmedium passes the first conveyance roller 114 and the second conveyanceroller 115.

As shown in FIG. 7B, the medium M vibrates due to the impact ofseparation from the first conveyance roller 114 and the secondconveyance roller 115 when the back end of the medium M passes the nipposition N2 of the first conveyance roller 114 and the second conveyanceroller 115. For this reason, the second imaging device 117 b pushed upby the medium M vibrates in association with the medium M.

The setting module 151 sets as the low reliability regions the regionscaptured by imaging devices 117 when the back end of the conveyed mediumpasses the first conveyance roller 114 and the second conveyance roller115. The setting module 151 sets as the front end position of the mediumthe position on the downstream side of the nip position N2 of the firstconveyance roller 114 and the second conveyance roller 115 by exactlythe amount of the long side size (or the amount of the short side size)of an ID card prescribed by ISO/IEC7810. The setting module 151 sets aslow reliability positions the positions on the back end of the mediumside of positions where the front end of the medium is included bydistances corresponding to distances between the set front end positionand the imaging positions P1, P2 of the imaging devices 117 in thevertical direction (sub scan direction) inside the input image. Further,the setting module 151 sets as the low reliability regions the regionsof a predetermined range centered about the set low reliabilitypositions in the vertical direction inside the input image. Due to this,the medium conveyance apparatus 100 can keep regions in which the tonalvalues of the background in the input image fluctuate from beingmistakenly detected as edges of the medium.

Note that the setting module 151 need not set all of the above regionsas the low reliability regions. At least one region may be set as thelow reliability region. In particular, in the region captured when themedium contacts the second imaging device 117 b, which is explained inFIG. 6A, the amount of fluctuation of the tonal value of the backgroundis small. For this reason, the setting module 151 need not set theregion as the low reliability region.

FIG. 8 and FIG. 9 are flow charts showing an example of the operation ofthe medium reading processing of the medium conveyance apparatus 100.

Below, referring to the flow charts shown in FIG. 8 and FIG. 9 , anexample of the operation of reading processing of the medium conveyanceapparatus 100 will be explained. Note that the flow of the operationexplained below is mainly performed by the processing circuit 150 incooperation with the elements of the medium conveyance apparatus 100based on a program stored in advance in the storage device 140. The flowof operation shown in FIG. 8 and FIG. 9 is performed periodically.

First, the control module 152 stands by until an instruction to read amedium is input by a user using the operating device 105 and receivingan operating signal for instructing reading of the medium from theoperating device 105 (step S101).

Next, the control module 152 determines whether the stacking tray 103has the medium stacked on it, based on the first medium signal receivedfrom the first medium sensor 111 (step S102).

If the stacking tray 103 does not have the medium stacked on it, thecontrol module 152 returns the processing to step S101 and stands byuntil newly receiving an operating signal from the operating device 105.

On the other hand, if the stacking tray 103 has the medium stacked onit, the control module 152 drives the motor 131 to make the feed roller112, brake roller 113, and first to fourth conveyance rollers 114, 115,118, and 119 rotate and convey the medium (step S103).

Next, the image acquisition module 153 makes the imaging devices 117capture the conveyed medium to acquire line images (step S104). Notethat the image acquisition module 153 may determine whether the frontend of the medium has passed the position of the second medium sensor116 based on the second medium signal received from the second mediumsensor 116 and may make the imaging devices 117 start capture when thefront end of the medium passes the position of the second medium sensor116. The image acquisition module 153 periodically acquires the secondmedium signal from the second medium sensor 116 and determines that thefront end of the medium has passed the position of the second mediumsensor 116 when the signal value of the second medium signal changesfrom a value showing a medium is not present to a value showing a mediumis present.

Next, the image acquisition module 153 determines whether the end partsin the main scan direction of the front end of the medium have beendetected by the end part detection module 155 (step S105). The end partsin the main scan direction of the front end of the medium are detectedat the later explained step S110. If the end parts in the main scandirection of the front end of the medium have been detected, the imageacquisition module 153 advances the processing to step S112.

On the other hand, if the end parts in the main scan direction of thefront end of the medium have not yet been detected, the imageacquisition module 153 determines whether predetermined numbers of lineimages have been acquired from the imaging devices 117 (step S106). Thepredetermined numbers are set in advance to values of 1 or more (forexample, 100) by which the end parts in the main scan direction of thefront end of the medium are considered to be reliably included. Thepredetermined numbers may be set to values by which the medium as awhole is included. The medium conveyance apparatus 100 can more reliablydetect the end parts the larger the predetermined numbers and can detectthe end parts faster the smaller the predetermined numbers. If thepredetermined numbers of line images have not yet been acquired, theimage acquisition module 153 returns the processing to step S104 andrepeats the processing of steps S104 to S106.

On the other hand, if acquiring the predetermined numbers of lineimages, the image acquisition module 153 combines the predeterminednumbers of line images to generate input image (step S107). In otherwords, the input image is an image of the medium captured by the imagingdevices 117 and generated by the image acquisition module 153. Note thatthe imaging devices 117 may combine the predetermined numbers of lineimages to generate input image and the image acquisition module 153 mayacquire the input image from the imaging devices 117.

FIG. 10 is a schematic view showing one example of input image 1000.

The input image 1000 shown in FIG. 10 include the medium 1001. Further,the reference member 122 is included as a background 1002. Thebackground 1002 includes the vertical stripe noises 1003, 1004, suddennoises 1005, 1006, and horizontal stripe noises 1007, 1008, 1009. Thevertical stripe noises 1003, 1004 are noises generated due to paperpowder, dust, paste, or other foreign matter deposited on the imagingsurfaces (glass surfaces) of the imaging devices 117 or unevensensitivity of the line sensors. “Sudden noise” is noise generated whenamplifying electrical signals output from imaging elements inside theimaging devices 117 or noise generated due to differences in thecharacteristics of the individual parts, etc. “Horizontal stripe noise”is noise generated due to the second imaging device 117 b moving in theheight direction A8.

The horizontal stripe noise 1007 is noise generated when the back end ofthe medium 1001 passes the feed roller 112 and brake roller 113. Thehorizontal stripe noise 1008 is noise generated when the front end ofthe medium 1001 passes the third conveyance roller 118 and fourthconveyance roller 119. The horizontal stripe noise 1009 is noisegenerated when the back end of the medium 1001 passes the firstconveyance roller 114 and the second conveyance roller 115. In theexample shown in FIG. 10 , in the region captured when the medium nippedbetween the feed roller 112 and brake roller 113 contacts the secondimaging device 117 b, the amount of fluctuation of the tonal values issufficiently small and no horizontal stripe noise is generated.

Next, the edge pixel detection module 154 reads out the region tablefrom the storage device 140 and identifies the low reliability regions(step S108). In the example explained using FIG. 10 , regions capturedby the imaging devices 117 when the back end of the medium passes thefeed roller 112 and brake roller 113, when the front end of the mediumpasses the third conveyance roller 118 and fourth conveyance roller 119,and when the back end of the medium passes the first conveyance roller114 and the second conveyance roller 115, inside the input image, areset as the low reliability regions. On the other hand, the regionscaptured by the imaging devices 117 when the medium nipped at theconveying modules contacts the second imaging device 117 b, inside theinput image, are not set as the low reliability region.

Next, the edge pixel detection module 154 detects pluralities of edgepixels in the sub scan direction from the input image (step S109). Theedge pixel detection module 154 detects the edge pixels in the sub scandirection based on the tonal values of the pluralities of pixels withpositions in the main scan direction which are the same as each otherand with distances in the sub scan direction which are within apredetermined range of each other inside the input image.

The edge pixel detection module 154 calculates an absolute value of thedifference of the tonal values of two adjoining pixels inside the inputimage (below, referred to as the “adjoining difference value”) in orderfrom the top side for each vertical line extending in the verticaldirection (sub scan direction). The edge pixel detection module 154detects as edge pixels the pixels with an adjoining difference valuewhich is over the tone threshold value inside the vertical lines. Theedge pixel detection module 154 determines as top end edge pixels theedge pixels first detected inside the vertical lines, i.e., the pixelspositioned at the top-most side, and detects them as edge pixels in thesub scan direction. The tonal value is a brightness value or color value(R value, G value, or B value), etc. The tone threshold value is, forexample, set to the difference of the brightness value (for example, 20)enabling a person to be able to visually determine a difference ofbrightness of the image.

Note that the edge pixel detection module 154 may calculate as theadjoining difference value the absolute value of the difference of tonalvalues of two pixels separated by exactly a predetermined distance froma pixel inside the input image in the vertical direction. Further, theedge pixel detection module 154 may compare the tonal values of thepixels inside the input image with a threshold value to thereby detectthe edge pixels. For example, the edge pixel detection module 154detects specific pixels as edge pixels if the tonal values of thespecific pixels are less than the threshold value and the tonal valuesof pixels adjoining the specific pixels or pixels separated from them byexactly a predetermined distance in the vertical direction are thethreshold value or more.

Further, the edge pixel detection module 154 need not detect the edgepixels in the sub scan direction for all of the pixels inside the inputimage and may detect the edge pixels in the sub scan direction for everycertain interval (for example, 4 pixels) in the main scan directioninside the input image. The edge pixel detection module 154 detects thetarget lines for detecting the edge pixels in the sub scan direction forevery certain interval from among the vertical lines inside the inputimage and detects the edge pixels in the sub scan direction for theextracted target lines. Due to this, the edge pixel detection module 154can reduce the time period required for detecting the end parts of themedium and lower the processing time and processing load of the mediumreading processing.

The edge pixel detection module 154 identifies as positions at which thefront end of the medium is included the positions of the edge pixelsdetected at the top-most side in the sub scan direction inside the inputimage and identifies the regions set as the low reliability regions withreference to the identified positions. The edge pixel detection module154 does not detect edge pixels in the sub scan direction from theidentified low reliability regions but detects the edge pixels in thesub scan direction from only regions not including the low reliabilityregions inside the input image.

Note that the edge pixel detection module 154 may identify the lowreliability regions captured by the imaging devices 117 when the backend of the medium passes the feed roller 112 and brake roller 113 insidethe input image, based on the first medium signal received from thefirst medium sensor 111. In this case, the edge pixel detection module154 periodically acquires the first medium signal from the first mediumsensor 111. When the signal value of the first medium signal changesfrom a value showing a medium is present to a value showing a medium isnot present, the edge pixel detection module 154 determines that theback end of the medium is positioned right before the nip position ofthe feed roller 112 and brake roller 113. The edge pixel detectionmodule 154 identifies as the low reliability regions the regions insideinput image captured by the imaging devices 117 within a certain timeperiod from when determining that the back end of the medium ispositioned right before the nip position of the feed roller 112 andbrake roller 113.

Similarly, the edge pixel detection module 154 may identify the lowreliability regions captured by the imaging devices 117 when the backend of the medium passes the first conveyance roller 114 and the secondconveyance roller 115 inside the input image based on the first mediumsignal received from the first medium sensor 111. The edge pixeldetection module 154 determines that the back end of the medium ispositioned right before the first conveyance roller 114 and the secondconveyance roller 115 when a predetermined time period corresponding toa predetermined amount of movement of the medium elapses from whendetermining that the back end of the medium is positioned right beforethe nip position of the feed roller 112 and brake roller 113. The edgepixel detection module 154 determines as the low reliability regions theregions captured by the imaging devices 117 within a certain time periodfrom when determining that the back end of the medium is positionedright before the first conveyance roller 114 and the second conveyanceroller 115 inside input image.

FIG. 11 is a schematic view for explaining the top end edge pixels.

FIG. 11 shows the input image 1000 shown in FIG. 10 . In FIG. 11 , thebroken lines extending in the vertical direction show the vertical linesextracted as the target lines. In the example shown in FIG. 11 , thepixels T1 to T14 are detected as top end edge pixels. The top end edgepixels T1, T2 are respectively pixels corresponding to the sudden noises1005, 1006. The top end edge pixel T3 is a pixel corresponding to theleft side of the medium. The top end edge pixels T4 to T14 are pixelscorresponding to the top side of the medium. As shown in FIG. 11 , thevertical stripe noises 1003, 1004 extend in the vertical direction andthe tonal values of the pixels in the vertical stripe noises 1003, 1004are within a certain range, so the pixels corresponding to the verticalstripe noises 1003, 1004 are not detected as the top end edge pixels.Note that the vertical stripe noise generated or extinguished during thereading (during conveyance of the medium) has changes in tonal values atits end parts, so is detected in the same way as sudden noises 1005,1006. Such vertical stripe noise generated or extinguished during thereading (during conveyance of the medium) is processed in the same wayas the sudden noises 1005, 1006 in the later explained processing and isnot mistakenly detected as an end part of the medium. Further, thevicinities of the horizontal stripe noises 1007, 1008, 1009 are set asthe low reliability regions, so the pixels corresponding to thehorizontal stripe noises 1007, 1008, 1009 are not detected as the topend edge pixels.

Next, the end part detection module 155 detects the end parts in themain scan direction of the front end of the medium, based on the edgepixels in the sub scan direction detected from regions not including thelow reliability regions inside the input image (step S110). The end partdetection module 155 detects the end parts in the main scan direction ofthe front end of the medium, based on the positional relationship amongthe pluralities of edge pixels in the sub scan direction detected by theedge pixel detection module 154.

For example, the end part detection module 155 calculates, as thepositional relationship among the pluralities of edge pixels in the subscan direction, the number or ratio of edge pixels in the sub scandirection in a certain range in the main scan direction, i.e., thedensity of edge pixels in the sub scan direction in a certain range inthe main scan direction. The end part detection module 155 calculatesthe number or ratio of target lines in which edge pixels in the sub scandirection are detected, among the target lines positioned in a certainrange of the target lines for each target line extracted from thevertical lines. The certain range is set so that the number of thetarget for which the number or ratio is calculated, is a predeterminednumber (for example 5) of 2 or more. The end part detection module 155extracts the group of target lines comprised of the consecutive targetlines with calculated values of the threshold value (for example 3) ormore or the target lines with calculated ratios of the threshold value(for example 0.6) or more adjoining each other.

The end part detection module 155 detects as the range of the front endof the medium in the main scan direction the range of the group oftarget lines with the greatest number of target lines included among theextracted groups of target lines in the main scan direction. Note thatthe end part detection module 155 may detect as the range of the frontend of the medium in the main scan direction the range reducing thedetected range by exactly a predetermined margin or the range expandingthe detected range by exactly a predetermined margin. The end partdetection module 155 detects as the end parts in the main scan directionof the front end of the medium the positions of the two ends of thegroup of target lines detected as the range of the front end of themedium in the main scan direction.

In the example shown in FIG. 11 , the range of the target line includingthe top end edge pixel T3 to the target line including the top end edgepixel T14 is detected as the range of the front end of the medium.Further, the target line including the top end edge pixel T3 and thetarget line including the top end edge pixel T14 are detected as the endparts in the main scan direction of the front end of the medium. Inother words, the pixels corresponding to the vertical stripe noises1003, 1004 are not detected as the top end edge pixels, so are notincluded in the range of the front end of the medium. Further, thetarget lines including the top end edge pixels T1, T2 corresponding tothe sudden noises 1005, 1006 are positioned scattered, so they are notincluded in the range of the front end of the medium. Further, thepixels corresponding to the horizontal stripe noises 1007, 1008, 1009are not detected as top end edge pixels, so are not included in therange of the front end of the medium. Further, even if the differencebetween the tonal values of the background and medium were small at partof the target lines corresponding to the front end of the medium and thetop end edge pixels were not detected, if the top end edge pixels aredetected at the target lines in the surroundings, that part of thetarget lines also is included in the range of the front end of themedium.

The end part detection module 155 can use the number or ratio of theedge pixels in the sub scan direction in a certain range to reduce theeffects of noise and the effects of missed detection of the top end edgepixels so as to highly precisely detect the range of the front end ofthe medium and its end parts. In particular, the horizontal stripe noiseis detected as the edge pixels in the sub scan direction, so whenutilizing the edge pixels in the sub scan direction to utilize the rangeof the front end of the medium, this becomes a factor behind mistakenlydetecting the range of the front end of the medium. The end partdetection module 155 can remove the regions in which horizontal stripenoise is generated, from the regions for detecting the top end edgepixels and thereby utilize the top end edge pixels to highly preciselydetect the range of the front end of the medium and the its end parts.

Note that the end part detection module 155 may detect the edge pixelsin the sub scan direction consecutively detected in the main scandirection as the positional relationship among the pluralities of edgepixels in the sub scan direction. In this case, the end part detectionmodule 155 calculates the number (consecutive number) of edge pixels inthe sub scan direction consecutively detected in the main scandirection. The end part detection module 155 extracts a group of targetlines comprised of a predetermined number (for example, three) or moreof consecutive adjoining target lines with detected edge pixels in thesub scan direction.

The end part detection module 155 detects as the range of the front endof the medium in the main scan direction the range of the group oftarget lines with the greatest number of target lines included among theextracted groups of target lines in the main scan direction. Note thatthe end part detection module 155 may detect as the range of the frontend of the medium in the main scan direction the range reducing thedetected range by exactly a predetermined margin or the range expandingthe detected range by exactly a predetermined margin. The end partdetection module 155 detects as the end parts in the main scan directionof the front end of the medium the positions of the two ends of thegroup of target lines detected as the range of the front end of themedium in the main scan direction.

In the example shown in FIG. 11 , the range of the target line includingthe top end edge pixel T3 to the target line including the top end edgepixel T14 is detected as the range of the front end of the medium.Further, the target line including the top end edge pixel T3 and thetarget line including the top end edge pixel T14 are detected as endparts in the main scan direction of the front end of the medium. Inother words, pixels corresponding to the vertical stripe noises 1003,1004 are not detected as the top end edge pixels, so are not included inthe range of the front end of the medium. Further, the target linesincluding the top end edge pixels T1, T2 corresponding to the suddennoises 1005, 1006 are positioned scattered, so are not included in therange of the front end of the medium. Further, the pixels correspondingto the horizontal stripe noises 1007, 1008, 1009 are not detected as topend edge pixels, so are not included in the range of the front end ofthe medium.

In this case, if the top end edge pixels are not detected at some of thetarget lines in the target lines corresponding to the front end of themedium, the range of the front end of the medium is not correctlydetected. However, the consecutive number of edge pixels in the sub scandirection is calculated in a short time period by the number or ratio ofedge pixels in the sub scan direction in a certain range. Therefore, theend part detection module 155 can reduce the effect of noise whiledetecting the range of the front end of the medium and its end parts ina shorter time period and with a lower load based on the edge pixels inthe sub scan direction consecutively detected in the main scandirection. In particular, the end part detection module 155 can removethe regions in which horizontal stripe noise is generated, from theregions for detecting the top end edge pixels and thereby utilize thetop end edge pixels to highly precisely detect the range of the frontend of the medium and its end parts.

Further, the end part detection module 155 may calculate the closenessof positions in the sub scan direction as the positional relationshipamong a plurality of edge pixels in the sub scan direction. For example,the end part detection module 155 calculates as the closeness of thepositions in the sub scan direction the distance in the sub scandirection among the plurality of edge pixels in the sub scan direction.The end part detection module 155 extracts the group of target lines inwhich the target lines with edge pixels in the sub scan directiondetected are positioned within a first distance from each other in themain scan direction and with edge pixels in the sub scan directiondetected in the target lines positioned within a second distance in thesub scan direction. The first distance is, for example, set to apredetermined multiple (for example, 2×) of the distance between targetlines adjoining each other. The second distance is, for example, set toa predetermined multiple (for example, 2×) of the distance betweentarget lines adjoining each other.

The end part detection module 155 detects the range of the group oftarget lines in the main scan direction with the greatest number oftarget lines included among the extracted groups of target lines as thefront end range of the medium in the main scan direction. Note that theend part detection module 155 may detect the range reducing the detectedrange by exactly a predetermined margin or the range expanding thedetected range by exactly a predetermined margin as the front end rangeof the medium in the main scan direction. The end part detection module155 detects the positions of the two ends of the group of target linesdetected as the range of the front end of the medium in the main scandirection as the end parts in the main scan direction of the front endof the medium.

In the example shown in FIG. 11 , the range of the target line includingthe top end edge pixels T4 to the target line including the top end edgepixel T14 is detected as the range of the front end of the medium. Inother words, the pixels corresponding to the vertical stripe noises1003, 1004 are not detected as top end edge pixels, so are not includedin the range of the front end of the medium. Further, the target linesincluding the top end edge pixels T1, T2 corresponding to the suddennoises 1005, 1006 are positioned scattered, so are not included in therange of the front end of the medium. Further, the pixels correspondingto the horizontal stripe noises 1007, 1008, 1009 are not detected as topend edge pixels, so are not included in the range of the front end ofthe medium. Further, the top end edge pixel T3 corresponding to the leftside of the medium 1001 is separated in the main scan direction from thetop end edge pixels T4, T5 positioned in the vicinity in the sub scandirection, so the target line including the top end edge pixel T3 is notincluded in the range of the front end of the medium.

Further, even if sudden noise is generated in the vicinity of the mediumin the main scan direction, if the sudden noise is separated from thefront end of the medium in the sub scan direction, that sudden noise isnot included in the range of the front end of the medium. The end partdetection module 155 can use the distance of the edge pixels in the subscan direction and thereby reduce the effects of noise and the effectsof the lateral sides of the medium to highly precisely detect the rangeof the front end of the medium and its end parts. In particular, the endpart detection module 155 can remove the regions in which horizontalstripe noise is generated, from the regions for detecting the top endedge pixels and thereby utilize the top end edge pixels to highlyprecisely detect the range of the front end of the medium and its endparts.

Further, the end part detection module 155 may calculate as thecloseness of positions in the sub scan direction the frequency of edgepixels in the sub scan direction for each of the plurality of lines inthe main scan direction. The end part detection module 155 calculatesthe number of edge pixels in the sub scan direction detected on a linein the main scan direction for each line in the main scan direction. Theend part detection module 155 generates a histogram having as a classthe positions of lines in the sub scan direction in the main scandirection and as a frequency the number calculated for each line in themain scan direction. The end part detection module 155 extracts as thegroup of target lines the target lines at which edge pixels in the subscan direction are detected, in the range of class of a frequency of thefrequency threshold value or more in the generated histogram. Thefrequency threshold value is set in advance to a predetermined value(for example, 3). Note that the frequency threshold value may be setdynamically in accordance with the generated histogram. In this case,the frequency threshold value is, for example, set to ½ of the maximumfrequency, etc.

The end part detection module 155 detects as the range in the main scandirection of the front end of the medium the range in the main scandirection of the group of target lines extracted. Note that the end partdetection module 155 may detect as the range in the main scan directionof the front end of the medium the range reducing the detected range byexactly a predetermined margin or the range expanding the detected rangeby exactly a predetermined margin. The end part detection module 155detects as the end parts in the main scan direction of the front end ofthe medium the positions of the two ends of the group of target linesdetected as the range in the main scan direction of the front end of themedium.

FIG. 12 is a schematic view for explaining a histogram 1200 generated bythe end part detection module 155.

FIG. 12 shows the histogram 1200 generated from the input image 1000shown in FIG. 10 . In FIG. 12 , the ordinate shows the positions (class)in the sub scan direction of lines in the main scan direction while theabscissa shows the numbers (frequencies) calculated for each line in themain scan direction. In the example shown in FIG. 12 , the frequency ishigher in the range where the top end edge pixels T4 to T14corresponding to the top side of the medium are present, in the sub scandirection. On the other hand, the frequency is lower at the positionswhere the top end edge pixels T1, T2 corresponding to the sudden noises1005, 1006 and the top end edge pixel T3 corresponding to the left sideof the medium are present.

Therefore, in the example shown in FIG. 11 , the range of the targetline including the top end edge pixel T4 to the target line includingthe top end edge pixel T14 is detected as the range of the front end ofthe medium. In other words, the target lines including the top end edgepixels T1, T2 corresponding to the sudden noises 1005, 1006 and thetarget line including the top end edge pixel T3 corresponding to theleft side of the medium 1001 are not included in the range of the frontend of the medium. By using the frequency of the edge pixels in the subscan direction for each line in the main scan direction, the end partdetection module 155 can reduce the effects of noise and the effects ofthe lateral sides of the medium so as to highly precisely detect therange of the front end of the medium and its end parts. In particular,the end part detection module 155 can remove the regions in whichhorizontal stripe noise is generated, from the regions for detecting thetop end edge pixels and thereby utilize the top end edge pixels tohighly precisely detect the range of the front end of the medium and itsend parts.

Next, the medium width detection module 156 detects the medium widthbased on the end parts in the main scan direction of the front end ofthe medium, detected by the end part detection module 155 (step S111).The medium width detection module 156, for example, detects as themedium width the Euclidian distance between the two end parts in themain scan direction at the front end of the medium. The medium widthdetection module 156 calculates the Euclidian distance W between the twoend parts in the main scan direction of the front end of the medium inaccordance with the following formula (1).

[Mathematical 1]

W=√{square root over ((x ₂ −x ₁)²+(y ₂ −y ₁)²)}  (1)

where, (x₁, y₁) is the coordinate of one end part in the main scandirection of the front end of the medium in the coordinate system havingthe main scan direction as the x-axis and the sub scan direction as they-axis in the input image, while (x₂, y₂) is the coordinate of the otherend part in the main scan direction of the front end of the medium inthe coordinate system. Note that the medium conveyance apparatus 100 maystore in advance a table showing the relationship between thecoordinates of the end parts and the Euclidian distance, and the mediumwidth detection module 156 may acquire the Euclidian distance referringto the table.

Note that the medium width detection module 156 may detect as the mediumwidth the distance in the main scan direction between the two end partsin the main scan direction of the front end of the medium. In this case,the medium width detection module 156 calculates the distance W in themain scan direction between the two end parts in the main scan directionof the front end of the medium in accordance with the following formula(2).

[Mathematical 2]

W=|x ₂ −x ₁|  (2)

Next, the image acquisition module 153 determines whether the medium asa whole has been captured (step S112). The image acquisition module 153,for example, determines whether the back end of the medium has passedthe position of the second medium sensor 116 based on the second mediumsignal received from the second medium sensor 116. The image acquisitionmodule 153 periodically acquires the second medium signal from thesecond medium sensor 116 and determines that the front end of the mediumhas passed the position of the second medium sensor 116 when the signalvalue of the second medium signal changes from a value showing that themedium is present to a value showing that the medium is not present. Theimage acquisition module 153 determines that the back end of the mediumhas passed the imaging positions of the imaging devices 117 and themedium as a whole has been captured when a predetermined time periodelapses from when the back end of the medium passes the position of thesecond medium sensor 116. Note that the image acquisition module 153 maydetermine that the conveyed medium as a whole has been captured whenacquiring predetermined numbers of line images from the imaging devices117.

If the conveyed medium as a whole is still not captured, the imageacquisition module 153 returns the processing to step S104 and repeatsthe processing of steps S104 to S112.

On the other hand, if the conveyed medium as a whole is captured, theimage acquisition module 153 combines all of the line images acquired togenerate read image (step S113). Note that when the numbers(predetermined numbers) of lines included in the input image are set tovalues in which the entire medium is included, the image acquisitionmodule 153 may use the input image as the read image.

Next, the edge pixel detection module 154 detects pluralities of edgepixels in the main scan direction from the read image (step S114). Theedge pixel detection module 154 detects the edge pixels in the main scandirection based on the tonal values of the pluralities of pixels withpositions in the sub scan direction which are the same as each otherinside the read image and with distances in the main scan directionwhich are inside a predetermined range of each other. Further, the edgepixel detection module 154 detects the edge pixels in the main scandirection inside a predetermined range of the two ends parts in the mainscan direction of the front end of the medium detected by the end partdetection module 155 in the main scan direction.

The end part detection module 155 calculates the adjoining differencevalues in the horizontal direction of pixels in the horizontal lines inorder from the left side inside a range of a predetermined distance fromthe left end of the front end of the medium detected by the end partdetection module 155 for each horizontal line extending in thehorizontal direction (main scan direction) inside the read image. Theend part detection module 155 detects as the edge pixels the pixels withadjoining difference values in the horizontal lines which exceed thetone threshold value. The end part detection module 155 determines asthe left end edge pixels the edge pixels first detected in thehorizontal lines, i.e., the pixels positioned at the left-most sides inthe range of a predetermined distance from the left end of the front endof the medium detected by the end part detection module 155. Similarly,the end part detection module 155 detects edge pixels in order from theright side in the range of a predetermined distance from the right endof the front end of the medium detected by the end part detection module155. The end part detection module 155 determines as the right end edgepixels the edge pixels first detected in the horizontal lines, i.e., thepixels positioned at the right-most sides in the range of apredetermined distance from the right end of the front end of the mediumdetected by the end part detection module 155. The end part detectionmodule 155 detects the left end edge pixels and right end edge pixels asthe edge pixels in the main scan direction.

Note that the end part detection module 155 may calculate as theadjoining difference value the absolute value of the difference of thetonal values of two pixels separated by exactly a predetermined distancein the horizontal direction from the pixels inside the read image.Further, the end part detection module 155 may detect edge pixels bycomparing the tonal values of the pixels inside the read image with athreshold value. For example, the end part detection module 155 detectsa specific pixel as an edge pixel when the tonal value of the specificpixel is less than a threshold value of the tonal value and the tonalvalues of pixels adjoining that specific pixel or pixels separated fromit by exactly a predetermined distance in the horizontal direction arethe threshold values or more.

Further, the end part detection module 155 need not detect the edgepixels in the main scan direction for all of the pixels inside the readimage and may detect the edge pixels in the main scan direction for eachconstant interval (for example, 4 pixels) in the sub scan directioninside the read image. The end part detection module 155 extracts fromthe horizontal lines in the read image the target lines for detectingthe edge pixels in the main scan direction for each constant intervaland detects the edge pixels in the main scan direction for the extractedtarget lines. Due to this, the end part detection module 155 can reducethe time required for detection of the end parts of the medium andreduce the processing time and processing load of the medium readingprocessing.

Further, in the same way as the case of detecting the edge pixels in thesub scan direction, the edge pixel detection module 154 does not detectedge pixels in the main scan direction from the low reliability regionsbut detects edge pixels in the main scan direction only from regions notincluding low reliability regions inside the input image.

FIG. 13 is a view for explaining left end edge pixels and right end edgepixels.

In FIG. 13 , the input image 1000 shown in FIG. 10 are shown. In FIG. 10, the broken lines extending in the horizontal direction show horizontallines extracted as target lines. In the example shown in FIG. 13 , thepixels L1 to L11 are detected as left end edge pixels while the pixelsR1 to R11 are detected as right end edge pixels. The left end edgepixels L1 to L11 are respectively pixels corresponding to the left sideof the medium. The right end edge pixels R1 to R11 are respectivelypixels corresponding to the right side of the medium. The edge pixelsare detected within a range of a predetermined distance in the main scandirection from the end parts T3, T14 of the front end of the mediumdetected by the end part detection module 155. For this reason, edgepixels corresponding to the lateral sides of the medium are detectedwell without being affected by the vertical stripe noises 1003, 1004 andsudden noises 1005, 1006. Further, the vicinities of the horizontalstripe noises 1007, 1008, and 1009 are set as the low reliabilityregions. For this reason, edge pixels corresponding to the lateral sidesof the medium are detected well without being affected by the horizontalstripe noises 1007, 1008, 1009.

Next, the end part detection module 155 detects as the end parts in themain scan direction of the medium the lateral sides of the medium basedon the edge pixels in the main scan direction (step S115). The end partdetection module 155 detects as the left side of the medium the linepassing through the left end edge pixels and detects as the right sideof the medium the line passing through the right end edge pixels, usingthe least square method. Note that the end part detection module 155 maydetect as a lateral side of the medium the line passing through the edgepixels using a Hough transform.

Next, the end part detection module 155 detects an end part in the mainscan direction of the back end of the medium (step S116). In the sameway as the processing of step S109, the edge pixel detection module 154detects the edge pixels in the input image or read image and detects asthe bottom end edge pixels (edge pixels in the sub scan direction) theedge pixels positioned at the bottom-most side in the vertical lines. Inthe same way as the processing of step S110, the end part detectionmodule 155 detects the end parts in the main scan direction of the backend of the medium based on the bottom end edge pixels.

Next, the output control module 157 cuts out regions of the medium fromthe read image to generate cutout image (step S117). The output controlmodule 157 uses the least square method or a Hough transform to detectthe line passing through the top end edge pixels as the top side of themedium and detect the line passing through the bottom end edge pixels asthe bottom side of the medium. The output control module 157 detects theregions surrounded by the detected top side and bottom side and the twolateral sides of the medium detected by the end part detection module155 as the regions of the medium. The output control module 157 cuts outthe detected regions of the medium to generate cutout image.

Next, the output control module 157 outputs the generated cutout imageby transmitting them through the interface device 132 to the informationprocessing apparatus (step S118). The output control module 157 mayoutput the generated cutout image by displaying it on the display device106. The lateral sides of the medium in the cutout image are the endparts in the main scan direction of the medium detected by the end partdetection module 155. The cutout image is examples of informationrelating to end parts detected by the end part detection module 155.Note that the output control module 157 may not generate cutout image,but transmit the read image to the information processing apparatus andtransmit coordinates showing the positions of end parts in the main scandirection of the medium detected by the end part detection module 155inside the read image as information relating to the end parts toinformation processing apparatus. In this case, the informationprocessing apparatus generates cutout image from the read image based onthe received coordinates.

Further, at step S110, the output control module 157 may determinewhether the medium is a card or printing paper based on the end parts ofthe front end of the medium detected by the end part detection module155. In this case, the output control module 157 determines that themedium is a card when the distance between end parts of the front end ofthe medium is a threshold value or less and determines that the mediumis printing paper when the distance between end parts of the front endof the medium is larger than the threshold value. The threshold valueis, for example, set to a value of the size of a card in thelongitudinal direction prescribed in ISO/IEC7810 plus a certain margin.The output control module 157 transmits information showing whether themedium is a card or printing paper as information relating to the endparts of the medium to the information processing apparatus. In thiscase, the information processing apparatus classifies the received imagein accordance with whether the medium is a card or is printing paper.Further, the output control module 157 may periodically determinewhether multi-feed of the medium has occurred based on an ultrasonicsignal output from a not shown ultrasonic sensor and may make conveyanceof the medium stop when multi-feed of the medium has occurred. In thiscase, when the medium is a card, the output control module 157 maydetermine that multi-feed of the medium has not occurred. Due to this,when a card is conveyed, the output control module 157 can keep it frombeing mistakenly determined that multi-feed of the medium has occurred.

Further, the output control module 157 may detect the size of the mediumbased on the end parts in the main scan direction of the medium detectedby the end part detection module 155 and change the rotation speeds ofthe third conveyance roller 118 and the fourth conveyance roller 119(ejection speed of medium) in accordance with the detected size of themedium. In this case, the output control module 157 detects as the sizeof the medium the distance between end parts in the main scan directionof the medium. Further, when at step S112 it was determined that themedium as a whole has been captured, the output control module 157changes the rotational speed of the motor 131 so as to change therotational speeds of the third conveyance roller 118 and fourthconveyance roller 119 in accordance with the detected size of themedium. The output control module 157 changes the rotational speed ofthe motor 131 so that the smaller the size of the medium, the lower(slower) the rotational speed and so that the larger the size of themedium, the higher (faster) the rotational speed. Due to this, themedium conveyance apparatus 100 can be kept from ejecting a small sizedmedium vigorously and scattering it on the ejection tray 104, to improvealignment of the medium on the ejection tray 104.

Further, at step S110, the output control module 157 determines whetherskew of the medium has occurred based on the end parts of the front endof the medium detected by the end part detection module 155. In thiscase, the medium conveyance apparatus 100 stores in advance in thestorage device 140 a table in which the ranges of positions of the endparts of the front end of the medium and the ranges of inclination ofthe front end of the medium (angle with respect to main scan direction)at which it is determined that skew of the medium has occurred are set.The output control module 157 calculates the inclination of a linepassing through the two end parts of the front end of the mediumdetected by the end part detection module 155. The output control module157 determines whether skew of the medium has occurred by whether thetwo end parts of the front end of the medium detected by the end partdetection module 155 and the calculated inclination are included in thepreset ranges. When it determines that skew of the medium has occurred,the output control module 157 stops the motor 131 to make the conveyanceof the medium stop and outputs information showing that an abnormalityhas occurred in the conveyance of the medium as information relating tothe end parts of the medium to notify the user.

Next, the control module 152 determines whether the stacking tray 103has the medium remaining on it based on the first medium signal receivedfrom the first medium sensor 111 (step S119). When the stacking tray 103has the medium remaining on it, the control module 152 returns theprocessing to step S104 and repeats the processing of steps S104 toS119.

On the other hand, when the stacking tray 103 does not have the mediumremaining on it, the control module 152 stops the motor 131 (step S120)and ends the series of steps.

Note that the processing of step S111 may be omitted. Further, theprocessing of steps S114 to S117 may be omitted and the output controlmodule 157 may output the read image at step S118. Further, at stepS109, the edge pixel detection module 154 may detect the edge pixels inthe sub scan direction from all regions inside the input image. In thiscase, at step S110, the end part detection module 155 detects the endpart in the main scan direction of the front end of the medium based ononly the edge pixels in the sub scan direction detected from regions notincluding low reliability regions among the edge pixels detected by theedge pixel detection module 154 in the input image. Simultaneously, atstep S114, the edge pixel detection module 154 may detect edge pixels inthe main scan direction from all regions inside the input image. In thiscase, at step S115, the end part detection module 155 detects the endparts in the main scan direction of the medium based on only the edgepixels in the main scan direction detected from regions not includinglow reliability regions among the edge pixels detected by the edge pixeldetection module 154 in the input image.

As explained in detail above, the medium conveyance apparatus 100detects the end parts in the main scan direction of the medium withoutusing edge pixels in the low reliability regions with tonal values ofthe reference members 122 which change in the input image when a card orother medium with high rigidity is conveyed. Due to this, the mediumconveyance apparatus 100 can remove noise generated due to movement ofthe second imaging device 117 b in the height direction A8 and highlyprecisely detect the end parts in the main scan direction of the mediumfrom the images.

In particular, the medium conveyance apparatus 100 can reduce the effectcaused by vertical stripe noise even when it cannot remove foreignmatter inside images using reference images acquired in advance such aswhen foreign matter deposits on or peels off from the imaging devices117 while reading the medium.

Further, the medium conveyance apparatus 100 detects the end parts inthe main scan direction of the front end of a medium before the mediumas a whole is captured based on input image including predeterminednumbers of line images, so can detect the end parts in the main scandirection of the front end of the medium early (in real time).

FIG. 14 and FIG. 15 are flow charts showing an example of the operationof other medium reading processing. The flow charts of FIG. 14 and FIG.15 are performed instead of the flow charts of FIG. 8 and FIG. 9 . Theprocessing of steps S201 to S207, S211 to S213, and S218 to S221 of FIG.14 and FIG. 15 is similar to the processing of steps S101 to S107, S111to S113, and S117 to S120 of FIG. 8 and FIG. 9 , so detailedexplanations will be omitted. Below, only steps S208 to S210 and S214 toS217 will be explained.

At step S208, in the same way as the processing of step S109 of FIG. 7 ,the edge pixel detection module 154 detects pluralities of edge pixelsin the sub scan direction from the input image (step S208). However, theedge pixel detection module 154 detects edge pixels in the sub scandirection from all regions in the input image.

Next, the fluctuation region detection module 158 detects fluctuationregions with tonal values fluctuating with respect to peripheral pixelsinside regions where the reference member 122 is included in the inputimage (step S209). The fluctuation region detection module 158 detectsfluctuation regions based on the positional relationship of thepluralities of edge pixels in the sub scan direction detected by theedge pixel detection module 154.

For example, the fluctuation region detection module 158 detects as theleft end edge pixels the pixels detected as the edge pixels in the subscan direction at the left-most side and detects as the right end edgepixels the pixels detected as the edge pixels in the sub scan directionat the right-most side for each horizontal line in the input image. Thefluctuation region detection module 158 calculates the fluctuationvalues of, with respect to positions of the left end edge pixel andright end edge pixel of each horizontal line, positions of the left endedge pixel and right end edge pixel of the horizontal line adjoining orwithin predetermined distance of each horizontal line below in the subscan direction. The fluctuation region detection module 158 calculatesas the fluctuation values of positions of the edge pixels the dividedvalues acquired by dividing the difference of positions in the main scandirection of two corresponding edge pixels by the difference ofpositions in the sub scan direction of the two edge pixels.

The fluctuation region detection module 158 scans the horizontal linesfrom the horizontal line positioned at the top-most side toward thebottom side and detects as a front end position of the medium a positionof the horizontal line with a magnitude of fluctuation value of any ofthe left end edge pixels or right end edge pixels which first becomes afluctuation threshold value or more. The fluctuation region detectionmodule 158 further scans the horizontal lines from the horizontal linedetected as the front end position toward the bottom side. Thefluctuation region detection module 158 detects as a fluctuation regiona region at the bottom side from a horizontal line with a magnitude offluctuation value of any of the left end edge pixels or right end edgepixels which once becomes less than the fluctuation threshold value,then again becomes the fluctuation threshold value or more or ahorizontal line at the top side from that horizontal line by exactly apredetermined margin.

FIG. 16 is a schematic view for explaining fluctuation regions.

The graph 1600 of FIG. 16 is a graph showing the positions of the leftend edge pixels and right end edge pixels inside the input image 1000.In the graph 1600, the ordinate shows positions in the sub scandirection inside the input image while the abscissa shows positions inthe main scan direction inside the input image. In the graph 1600, thesolid line 1601 shows the positions of the left end edge pixels, whilethe broken line 1602 shows the positions of the right end edge pixels.The region 1603 inside the solid line 1601 corresponds to the left sideof the medium 1001. The region 1604 corresponds to the horizontal stripenoise 1007. The region 1605 inside the broken line 1602 corresponds tothe top side of the medium 1001. The region 1606 corresponds to theright side of the medium 1001. The region 1607 corresponds to thehorizontal stripe noise 1007.

The graph 1620 of FIG. 16 is a graph showing the changes in positions ofthe left end edge pixels and right end edge pixels inside the inputimage 1000. In the graph 1620, the ordinate shows the positions in thesub scan direction inside the input image while the abscissa shows thefluctuation values. In the graph 1620, the solid line 1621 shows thefluctuation values of the left end edge pixels, while the broken line1622 shows the fluctuations values of the right end edge pixels. Theregions 1623 to 1624 inside the solid line 1621 correspond to theregions 1603 to 1604 inside the solid line 1601, while the regions 1625to 1627 inside the broken line 1622 correspond to the regions 1605 to1607 inside the broken line 1602.

In the graph 1620, if viewing the fluctuation values from the top end,first, the absolute values of the fluctuation values become larger atthe region 1625 of the right end edge pixels corresponding to the topside of the medium 1001. After that, the absolute values of thefluctuation values become smaller at the region 1623 of the left endedge pixels corresponding to the left side of the medium 1001 and theregion 1626 of the right end edge pixels corresponding to the right sideof the medium 1001. Further, in the region 1624 of the left end edgepixels and the region 1627 of the right end edge pixels corresponding tothe horizontal stripe noise 1007, the absolute values of the fluctuationvalues again become larger. For this reason, a region at the bottom sidefrom the region 1624 or region 1627 in the sub scan direction, i.e., theregion at the bottom side from the horizontal stripe noise 1007, isdetected as the fluctuation region.

Next, the end part detection module 155 detects the end part in the mainscan direction of the front end of the medium based on the edge pixelsin the sub scan direction detected from regions not includingfluctuation regions detected by the fluctuation region detection module158 inside the input image (step S210). The end part detection module155 detects the end parts in the main scan direction of the front end ofthe medium in the same way as the processing of step S110.

Further, at step S214, in the same way as the processing of step S14 ofFIG. 8 , the edge pixel detection module 154 detects pluralities of edgepixels in the main scan direction from the read image (step S214).However, the edge pixel detection module 154 detects the edge pixels inthe main scan direction from all regions at the inside of the readimage.

Next, the fluctuation region detection module 158 detects fluctuationregions based on the positional relationship of the plurality of edgepixels in the main scan direction detected by the edge pixel detectionmodule 154 (step S215).

The fluctuation region detection module 158 uses left end edge pixelsand right end edge pixels of the horizontal lines detected at step S214to detect fluctuation regions. The fluctuation region detection module158 calculates the fluctuation values of, with respect to positions ofthe left end edge pixel and right end edge pixel of each horizontalline, positions of the left end edge pixel and right end edge pixel ofthe horizontal line adjoining or within predetermined distance of eachhorizontal line below in the sub scan direction. The fluctuation regiondetection module 158 calculates as the fluctuation values of positionsof the edge pixels the divided values acquired by dividing thedifference of positions in the main scan direction of two correspondingedge pixels by the difference of positions in the sub scan direction ofthe two edge pixels.

The fluctuation region detection module 158 scans the horizontal linesfrom the horizontal line of the front end position of the mediumdetected at step S210 toward the bottom side. The fluctuation regiondetection module 158 detects as the fluctuation region a region with amagnitude of fluctuation value of any of the left end edge pixel orright end edge pixel in the sub scan direction which becomes afluctuation threshold value or more or a region expanding the region byexactly predetermined margins.

FIG. 17 is a schematic view for explaining fluctuation regions.

The graph 1700 of FIG. 17 is a graph showing the positions of the leftend edge pixels and right end edge pixels inside the input image 1000.In the graph 1700, the ordinate shows the positions in the sub scandirection inside the input image while the abscissa shows the positionsin the main scan direction inside the input image. In the graph 1700,the solid line 1701 shows the positions of the left end edge pixels,while the broken line 1702 shows the positions of the right end edgepixels. The region 1703 inside the solid line 1701 corresponds to thevertical stripe noise 1003. The region 1704 corresponds to the suddennoise 1005 and horizontal stripe noise 1007. The region 1705 correspondsto the horizontal stripe noise 1008. The region 1706 corresponds to thesudden noise 1006. The region 1707 corresponds to the horizontal stripenoise 1009. The region 1708 inside the broken line 1702 corresponds tothe vertical stripe noise 1004. The region 1709 corresponds to thehorizontal stripe noise 1007. The region 1710 corresponds to thehorizontal stripe noise 1008. The region 1711 corresponds to thehorizontal stripe noise 1009.

The graph 1720 of FIG. 17 is a graph showing the changes in positions ofthe left end edge pixels and right end edge pixels inside input image1000. In the graph 1720, the ordinate shows the positions in the subscan direction inside the input image while the abscissa shows thefluctuation values. In the graph 1720, the solid line 1721 shows thefluctuation values of the left end edge pixels, while the broken line1722 shows the fluctuation values of the right end edge pixels. Theregions 1723 to 1727 inside the solid line 1721 correspond to theregions 1703 to 1707 inside the solid line 1701, while the regions 1728to 1731 inside the broken line 1722 corresponds to the regions 1708 to1711 inside the broken line 1702.

In the graph 1720, if viewing the fluctuation values at the bottom sidefrom the front end position of the medium, the absolute values of thefluctuation values become larger in the regions corresponding to thehorizontal stripe noises 1007, 1008, 1009 and the regions correspondingto the sudden noises 1005, 1006. For this reason, in the sub scandirection, the regions corresponding to the horizontal stripe noises1007, 1008, and 1009 and the regions corresponding to the sudden noises1005, 1006 are detected as the fluctuation regions.

FIG. 18 is a schematic view for explaining other fluctuation regions.

The graph 1800 of FIG. 18 is a graph showing the positions of a left endedge pixel and right end edge pixel in the case where vertical stripenoises 1003, 1004 are not present in the input image 1000. In the graph1800, the ordinate shows the positions in the sub scan direction insidethe input image, while the abscissa shows the positions in the main scandirection inside the input image. In the graph 1800, the solid line 1801shows the position of the left end edge pixel, while the broken line1802 shows the position of the right end edge pixel. The region 1803inside the solid line 1801 corresponds to the left side of the medium1001. The region 1804 corresponds to the sudden noise 1005 andhorizontal stripe noise 1007. The region 1805 corresponds to thehorizontal stripe noise 1008. The region 1806 corresponds to the suddennoise 1006. The region 1807 corresponds to the horizontal stripe noise1009. The region 1808 corresponds to the lower side of the medium 1001.The region 1809 inside the broken line 1802 corresponds to the upperside of the medium 1001. The region 1810 corresponds to the right sideof the medium 1001. The region 1811 corresponds to the horizontal stripenoise 1007. The region 1812 corresponds to the horizontal stripe noise1008. The region 1813 corresponds to the horizontal stripe noise 1009.

The graph 1820 of FIG. 18 is a graph showing the changes in positions ofthe left end edge pixel and right end edge pixel inside the input image1000. In the graph 1820, the ordinate shows the position in the sub scandirection inside the input image while the abscissa shows thefluctuation value. In the graph 1820, the solid line 1821 shows thefluctuation value of the left end edge pixel, while the broken line 1822shows the fluctuation value of the right end edge pixel. The regions1823 to 1828 inside the solid line 1821 correspond to the regions 1803to 1808 inside the solid line 1801, while the regions 1829 to 1833inside the broken line 1822 correspond to the regions 1809 to 1813inside the broken line 1802.

In the graph 1820, if viewing the fluctuation values at the bottom sidefrom the front end position of the medium, the absolute values of thefluctuation values become larger in the regions corresponding to thehorizontal stripe noises 1007, 1008, 1009 and regions corresponding tothe sudden noises 1005, 1006. For this reason, the regions correspondingto the horizontal stripe noises 1007, 1008, 1009 in the sub scandirection and the regions corresponding to the sudden noises 1005, 1006are detected as the fluctuation regions.

Next, the end part detection module 155 detects as end parts in the mainscan direction of a medium the lateral sides of the medium based on edgepixels in the main scan direction detected from regions not includingfluctuation regions detected by the fluctuation region detection module158 inside the read image (step S216). In this case, in the same way asthe processing of step S114, the edge pixel detection module 154 againdetects pluralities of edge pixels in the main scan direction from theread image. In other words, the edge pixel detection module 154 detectsthe edge pixels in the main scan direction in regions within apredetermined distance from the two end parts in the main scan directionof the front end of the medium detected by the end part detection module155 in the main scan direction. Further, in the same way as theprocessing of step S115, the end part detection module 155 detects theend parts of the medium in the main scan direction.

Next, the end part detection module 155 detects end parts in the mainscan direction of the back end of the medium based on the edge pixels inthe sub scan direction detected from the regions not includingfluctuation regions detected by the fluctuation region detection module158 inside the read image (step S217).

The edge pixel detection module 154, in the same way as the processingof step S208, detects the edge pixels inside the input image or readimage and detects the pixels positioned at the lowest side inside thevertical lines as bottom end edge pixels (edge pixels in sub scandirection). Further, the end part detection module 155, in the same wayas the processing of step S209, detects the end parts in the main scandirection of the back end of the medium based on the bottom end edgepixels. The fluctuation region detection module 158 scans the horizontallines from the horizontal line positioned at the bottommost side towardthe top side and detects the position of the horizontal line with amagnitude of any fluctuation value of the left end edge pixels or rightend edge pixels which has first become a fluctuation threshold value ormore as the back end position of the medium. The fluctuation regiondetection module 158 further scans the horizontal lines from thehorizontal line detected as the back end position toward the top side.The fluctuation region detection module 158 detects as the fluctuationregion a region at the top side from a horizontal line with a magnitudeof any fluctuation value of the left end edge pixels or right end edgepixels which once becomes less than the fluctuation threshold value,then again becomes the fluctuation threshold value or more or ahorizontal line at the bottom side from that horizontal line by exactlya predetermined margin.

As explained in detail above, the medium conveyance apparatus 100 candynamically detect the fluctuation regions and detect the end parts inthe main scan direction of a medium from an image more precisely even ifdetecting the end parts in the main scan direction of the medium withoutusing edge pixels in the fluctuation regions.

In particular, the medium conveyance apparatus 100 can automaticallydetect the end parts of the medium without setting in advance regionsnot using the edge pixels and thereby detect the end parts of the mediumfrom an image regardless of the size, type, etc. of the medium.

FIG. 19 is a view showing the schematic constitution of a processingcircuit 250 in an image reading device of still another embodiment. Theprocessing circuit 250 is used in place of the processing circuit 150 ofthe medium conveyance apparatus 100 and performs the medium readingprocessing. The processing circuit 250 has a setting circuit 251,control circuit 252, image acquisition circuit 253, edge pixel detectioncircuit 254, end part detection circuit 255, medium width detectioncircuit 256, output control circuit 257, fluctuation region detectioncircuit 258, etc. Note that these parts may be configured byrespectively independent integrated circuits, microprocessors, firmware,etc.

The setting circuit 251 is one example of the setting module and has afunction similar to the setting module 151. The setting circuit 251 setsthe low reliability regions and stores them in the storage device 140.

The control circuit 252 is one example of the control module and has afunction similar to the control module 152. The control circuit 252receives an operating signal from the operating device 105 and a mediumdetection signal from the first medium sensor 111 and drives the motor131 in accordance with the received signals to control conveyance of themedium.

The image acquisition circuit 253 is one example of the imageacquisition module and has a function similar to the image acquisitionmodule 153. The image acquisition circuit 253 receives a second mediumsignal from the second medium sensor 116 and receives line images fromthe imaging devices 117 to generate input image and stores the lineimages and input image in the storage device 140.

The edge pixel detection circuit 254 is one example of the edge pixeldetection module and has a function similar to the edge pixel detectionmodule 154. The edge pixel detection circuit 254 reads out the inputimage from the storage device 140, detects edge pixels from the inputimage, and stores the detection results in the storage device 140.

The end part detection circuit 255 is one example of the end partdetection module and has a function similar to the end part detectionmodule 155. The end part detection circuit 255 reads out input image,detection results of edge pixels, setting information of the lowreliability regions, or detection results of fluctuation regions fromthe storage device 140. The end part detection circuit 255 detects theend parts in the main scan direction of the medium based on the edgepixels detected from regions not including low reliability regions orfluctuation regions inside the input image and stores the detectionresults in the storage device 140.

The medium width detection circuit 256 is one example of the mediumwidth detection module and has a function similar to the medium widthdetection module 156. The medium width detection circuit 256 reads outdetection results of the end parts in the main scan direction of themedium from the storage device 140, detects the medium width based onthe end parts in the main scan direction of the medium, and stores thedetection results in the storage device 140.

The output control circuit 257 is one example of the output controlmodule and has a function similar to the output control module 157. Theoutput control circuit 257 reads out line images from the storage device140 and generates read image. Further, the output control circuit 257reads out detection results of the end parts in the main scan directionof the medium, generates cutout image based on the end parts in the mainscan direction of the medium, and transmits them to a not showninformation processing apparatus through the interface device 132.

The fluctuation region detection circuit 258 is one example of thefluctuation region detection module and has a function similar to thefluctuation region detection module 158. The fluctuation regiondetection circuit 258 reads input image and detection results of edgepixels from the storage device 140, detects fluctuation regions based onthe positional relationship of the pluralities of edge pixels, andstores the detection results in the storage device 140.

As explained in detail above, the image reading device can moreprecisely detect the end parts in the main scan direction of a mediumfrom an image even in the case of using a processing circuit 250.

REFERENCE SIGNS LIST

-   -   100 medium conveyance apparatus    -   112 feed roller    -   113 brake roller    -   114 first conveyance roller    -   115 second conveyance roller    -   117 imaging device    -   122 reference member    -   118 third conveyance roller    -   119 fourth conveyance roller    -   140 storage device    -   154 edge pixel detection module    -   155 end part detection module    -   156 medium width detection module    -   157 output control module    -   158 fluctuation region detection module

1. A medium conveyance apparatus comprising: a conveying roller toconvey a medium; an imaging device to capture an image of the conveyedmedium; a storage device to store a low reliability region inside aninput image of a medium captured by the imaging device based on apositional relationship between an imaging position of the imagingdevice and arrangement position of the conveying roller; and a processorto detect edge pixels from the input image, detect an end part in a mainscan direction of the medium based on edge pixels detected from a regionnot including the low reliability region inside the input image, andoutput information relating to the detected end part.
 2. The mediumconveyance apparatus according to claim 1, wherein the storage devicestores as the low reliability region a region captured by the imagingdevice when a front end or back end of the conveyed medium passes theconveying roller.
 3. The medium conveyance apparatus according to claim1, wherein the imaging device is provided to be able to move in a topdirection by being pushed up by the conveyed medium, and wherein thestorage device stores as the low reliability region a region captured bythe imaging device when a medium nipped by the conveying roller contactsthe imaging device or a member to move in association with the imagingdevice.
 4. A medium conveyance apparatus comprising: a conveying rollerto convey a medium; a reference member having a single color; an imagingdevice located facing the reference member, to capture an image of theconveyed medium and a vicinity of the conveyed medium; and a processorto detect a plurality of edge pixels from an input image of the mediumand vicinity of the medium captured by the imaging device, detect afluctuation region with tonal values fluctuating with respect toperipheral pixels inside a region where the reference member is includedin the input image based on a positional relationship of the pluralityof edge pixels detected, detect an end part in a main scan direction ofthe medium based on edge pixels detected from a region not including thefluctuation region detected inside the input image, and outputinformation relating to the detected end part.
 5. The medium conveyanceapparatus according to claim 1, wherein the processor detects as theedge pixels only edge pixels in a sub scan direction based on tonalvalues of a plurality of pixels with positions in the main scandirection which are the same as each other and with distances in the subscan direction which are within a predetermined range of each otherinside the input image.
 6. The medium conveyance apparatus according toclaim 1, wherein the processor detects a medium width based on end partsin a main scan direction of the medium detected.
 7. A method of forconveying a medium, the control method comprising: conveying a medium,by a conveying roller; capturing an image of the conveyed medium, by animaging device; storing in p storage device a low reliability regioninside an input image of a medium captured by the imaging device basedon a positional relationship between an imaging position of the imagingdevice and arrangement position of the conveying roller; detecting edgepixels from the input image; detecting an end part in a main scandirection of the medium based on edge pixels detected from a region notincluding the low reliability region inside the input image; andoutputting information relating to the detected end part.
 8. A methodfor conveying a medium, the control method comprising: conveying amedium, by a conveying roller; capturing an image of the conveyedmedium, by an imaging device located facing a reference member having asingle color; detecting a plurality of edge pixels from an input imageof the medium and vicinity of the medium captured by the imaging device;detecting a fluctuation region with tonal values fluctuating withrespect to peripheral pixels inside a region in which the referencemember is included in the input image based on a positional relationshipof a plurality of edge pixels detected; detecting an end part in a mainscan direction of the medium based on edge pixels detected from a regionnot including the fluctuation region inside the input image; andoutputting information relating to the detected end part.
 9. (canceled)10. (canceled)
 11. The medium conveyance apparatus according to claim 4,wherein the processor detects as the edge pixels only edge pixels in asub scan direction based on tonal values of a plurality of pixels withpositions in the main scan direction which are the same as each otherand with distances in the sub scan direction which are within apredetermined range of each other inside the input image.
 12. The mediumconveyance apparatus according to claim 4, wherein the processor detectsa medium width based on end parts in a main scan direction of the mediumdetected.
 13. The method according to claim 7, wherein the storagedevice stores as the low reliability region a region captured by theimaging device when a front end or back end of the conveyed mediumpasses the conveying roller.
 14. The method according to claim 7,wherein the imaging device is provided to be able to move in a topdirection by being pushed up by the conveyed medium, and wherein thestorage device stores as the low reliability region a region captured bythe imaging device when a medium nipped by the conveying roller contactsthe imaging device or a member to move in association with the imagingdevice.
 15. The method according to claim 7, wherein only edge pixels ina sub scan direction is detected as the edge pixels, based on tonalvalues of a plurality of pixels with positions in the main scandirection which are the same as each other and with distances in the subscan direction which are within a predetermined range of each otherinside the input image.
 16. The method according to claim 7, wherein amedium width is detected based on end parts in a main scan direction ofthe medium detected.
 17. The method according to claim 8, wherein onlyedge pixels in a sub scan direction is detected as the edge pixels,based on tonal values of a plurality of pixels with positions in themain scan direction which are the same as each other and with distancesin the sub scan direction which are within a predetermined range of eachother inside the input image.
 18. The method according to claim 8,wherein a medium width is detected based on end parts in a main scandirection of the medium detected.